home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue59 / Arch / Extended Sample / UnitFormEntityBase.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2000-05-17  |  1.7 KB  |  74 lines

  1. unit UnitFormEntityBase;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   UnitCommonTypes, ToolWin, ComCtrls, ActnList, Menus, ImgList, UnitFormBase,
  8.   UnitObjectEntityBase;
  9.  
  10. type
  11.   TFormEntityBase = class(TFormBase)
  12.     StatusBarEntity: TStatusBar;
  13.     ToolBarEntityAbstract: TToolBar;
  14.     ActionListEntity: TActionList;
  15.     ActionSave: TAction;
  16.     PopupMenuEntity: TPopupMenu;
  17.     Save1: TMenuItem;
  18.     ToolButtonSaveAbstract: TToolButton;
  19.     ActionShowHints: TAction;
  20.     N1: TMenuItem;
  21.     ShowHints1: TMenuItem;
  22.     ToolButtonEntityAbstractSeparator: TToolButton;
  23.     procedure ActionSaveExecute(Sender: TObject);
  24.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  25.     procedure ActionSaveUpdate(Sender: TObject);
  26.     procedure ActionShowHintsExecute(Sender: TObject);
  27.     procedure ActionShowHintsUpdate(Sender: TObject);
  28.   private
  29.   protected
  30.   public
  31.   end;
  32.  
  33. implementation
  34.  
  35. {$R *.DFM}
  36.  
  37. { TFormEntityAbstract }
  38.  
  39. procedure TFormEntityBase.ActionSaveExecute(Sender: TObject);
  40. begin
  41.   inherited;
  42.   Save;
  43. end;
  44.  
  45. procedure TFormEntityBase.FormClose(Sender: TObject;
  46.   var Action: TCloseAction);
  47. begin
  48.   inherited;
  49.   Action := caFree;
  50. end;
  51.  
  52. procedure TFormEntityBase.ActionSaveUpdate(Sender: TObject);
  53. var b: boolean;
  54. begin
  55.   inherited;
  56.   b := BusinessObject.UpdatesPending;
  57.   ActionSave.Enabled := b;
  58. end;
  59.  
  60. procedure TFormEntityBase.ActionShowHintsExecute(Sender: TObject);
  61. begin
  62.   inherited;
  63.   Self.ShowHint := not(Self.ShowHint);
  64. end;
  65.  
  66. procedure TFormEntityBase.ActionShowHintsUpdate(Sender: TObject);
  67. begin
  68.   inherited;
  69.   ActionShowHints.Checked := Self.ShowHint;
  70. end;
  71.  
  72.  
  73. end.
  74.